/*
 *所有关于Warehouse类的业务代码应在此处编写
*可使用repository.调用常用方法，获取EF/Dapper等信息
*如果需要事务请使用repository.DbContextBeginTransaction
*也可使用DBServerProvider.手动获取数据库相关信息
*用户信息、权限、角色等使用UserContext.Current操作
*WarehouseService对增、删、改查、导入、导出、审核业务代码扩展参照ServiceFunFilter
*/
using VOL.Core.BaseProvider;
using VOL.Core.Extensions.AutofacManager;
using VOL.Entity.DomainModels;
using System.Linq;
using VOL.Core.Utilities;
using System.Linq.Expressions;
using VOL.Core.Extensions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Domain.IRepositories;
using VOL.Domain.Infrastructure;
using VOL.Domain.IServices;

namespace VOL.Domain.Services
{
    public partial class WarehouseService: IWarehouseService
    {
        private readonly IBaseRepository<Warehouse> _warehouserep;

        public WarehouseService(IBaseRepository<Warehouse> warehouserep)
        {
            this._warehouserep = warehouserep;
        }
        public async Task<int> CreateWarehouse(Warehouse warehouse) 
        {
            var res = await _warehouserep.Add(warehouse);
            return res;
        }

        public async Task<List<Warehouse>> GetWarehouse() 
        {
            var res = _warehouserep.GetAll().ToList();
            return res;
        }
    }
}
